import { inject } from 'vue';
import { GRAPH_SYMBOL } from '../components/context.js';

export const useGraphContext = () => {
  const context = inject(GRAPH_SYMBOL, null);
  if (!context) {
    throw new Error('useGraphContext must be used inside LiteFlowEditor.');
  }
  return context;
};

